/*
 * User: gilad
 * Date: 23/06/2008 
 *
 * Copyright (2005) IDI. All rights reserved.
 * This software is a proprietary information of Israeli Direct Insurance.
 * Created by IntelliJ IDEA. 
 */
package com.idi.maven.plugins.servers;

import com.idi.maven.plugins.MavenCommandsEnum;

/**
 *
 */
public enum ServerDeployTypeEnum {

    IDI_EAR_DEPLOY("idi.ear", "idi.ear", "Deploy idi.ear", MavenCommandsEnum.EAR_REMOTE_DEPLOY),
    IDI_EAR_APPROVE("idi.ear.approve", "idi.ear", "Approve idi.ear", MavenCommandsEnum.EAR_REMOTE_APPROVE),
    WEBSTART_DEPLOY("webstart", "idi.webstart.zip", "Deploy Webstart", MavenCommandsEnum.WEBSTART_REMOTE_DEPLOY),
    WEBSTART_APPROVE("webstart.approve", "idi.webstart.zip", "Approve Webstart", MavenCommandsEnum.WEBSTART_REMOTE_APPROVE),
    SITE_WAR("site.war", "bareket-web.zip", "Deploy Site", MavenCommandsEnum.WAR_REMOTE_DEPLOY);

    private String propertyName;
    private String artifactName;
    private String displayName;
    private MavenCommandsEnum mavenCommandsEnum;

    ServerDeployTypeEnum(String propertyName, String artifactName, String displayName, MavenCommandsEnum mavenCommandsEnum) {
        this.propertyName = propertyName;
        this.artifactName = artifactName;
        this.displayName = displayName;
        this.mavenCommandsEnum=mavenCommandsEnum;
    }

    public String getPropertyName() {
        return propertyName;
    }

    public String getArtifactName() {
        return artifactName;
    }

    public String getDisplayName() {
        return displayName;
    }

    public MavenCommandsEnum getMavenCommandsEnum() {
        return mavenCommandsEnum;
    }

    public static ServerDeployTypeEnum resloveDeployType(String deployType) {
        if (IDI_EAR_DEPLOY.propertyName.equals(deployType)) {
            return IDI_EAR_DEPLOY;
        } else if (IDI_EAR_APPROVE.propertyName.equals(deployType)) {
            return IDI_EAR_APPROVE;
        } else if (WEBSTART_DEPLOY.propertyName.equals(deployType)) {
            return WEBSTART_DEPLOY;
        } else if (WEBSTART_APPROVE.propertyName.equals(deployType)) {
            return WEBSTART_APPROVE;
        }
        return SITE_WAR;
    }

}